package com.example.demo.designPattern.singleton;


public class Singleton {
    private static volatile Singleton singleton = null;

    private void Singleton() {

    }

    public static Singleton getInstance() {
        if (null == singleton) {
            synchronized (Singleton.class) {
                if (null == singleton) {
                    singleton = new Singleton();
                }
            }

        }
        return singleton;
    }
}
